
package com.work.jaxb;

import java.io.*;

import javax.xml.bind.SchemaOutputResolver;
import javax.xml.transform.Result;
import javax.xml.transform.stream.StreamResult;

import com.work.util.AppUtils;

public class MySchemaOutputResolver extends SchemaOutputResolver {

	String fileName;

	public MySchemaOutputResolver()
	{
		super();
	}

	public MySchemaOutputResolver(String fileName)
	{
		this();
		this.fileName = fileName;
	}

	@Override
	public Result createOutput(String namespaceUri, String suggestedFileName) throws IOException
	{
		StreamResult sr = new StreamResult(new File(AppUtils.getSchemasPath(), this.fileName));
		return sr;
	}

}
